package com.genice.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.genice.model.User;
import com.genice.service.UserService;
import com.genice.util.ErrorCode;
import com.genice.util.Result;



@Controller
@RequestMapping("/")
public class UserController {
	@Autowired
	private UserService userService;
	@RequestMapping("/")
	public String index(){
		return "main";
	}
	@RequestMapping(value = "/login", method = RequestMethod.POST)
	@ResponseBody
	public Result login(@RequestParam("email") String email){
//		String nickname=user.email;
//		User user=userService.getUserByName(nickname);
		System.out.println(email);
		return Result.OK("登录成功");
	
//		if(user!=null){
//			return Result.OK("登录成功");
//		}else{
//			return Result.FAILED(ErrorCode.E1010301);
//		}
	}
}
